package com.wangyk.rabbitmqconsole.controller;

import com.wangyk.rabbitmqcommon.model.console.Category;
import com.wangyk.rabbitmqcommon.resp.CommonResp;
import com.wangyk.rabbitmqcommon.resp.CommonRespCode;
import com.wangyk.rabbitmqconsole.service.CategoryService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/category")
public class CategoryController
{
    private Logger logger=LogManager.getLogger(CategoryController.class);

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/select_category_by_id.do")
    @ResponseBody
    public CommonResp selectUserById()
    {
        CommonResp resp=new CommonResp();
        Category category = categoryService.selectUserById(1);
        resp.setResult(category);
        resp.setMessage(CommonRespCode.SUCC_MSG);
        resp.setMessage(CommonRespCode.SUCC_CODE);
        return resp;
    }
}
